# cmake_minimum_required(VERSION 3.5)
# project(RTC)

# add_definitions(-std=c++11)
# add_definitions(-DWEBRTC_POSIX)
# add_definitions(-DWEBRTC_LINUX)
# # -fno-rtti 禁止运行时类型信息 不加会出现某些包含纯虚函数的类 undefine reference 暂时也没搞懂原因
# add_definitions(-D -fno-rtti)

# file(GLOB_RECURSE ali_LIB "/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/lib/*.a")

# include_directories(
#     /home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/include/webrtc
#     /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/abseil-cpp/
#     )
# # link_directories()

# add_executable( 
#     main.cpp 
#     srsconductor.cpp
# )
# target_link_libraries(${ali_LIB} pthread)




# cmake_minimum_required(VERSION 3.5)
# project(webRTC)

# add_definitions(-std=c++11)
# add_definitions(-DWEBRTC_POSIX)
# add_definitions(-DWEBRTC_LINUX)
# # -fno-rtti 禁止运行时类型信息 不加会出现某些包含纯虚函数的类 undefine reference 暂时也没搞懂原因
# add_definitions(-D -fno-rtti)

# include_directories(/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/include/webrtc
# /home/yqw/temp/webrtc_all/webrtc-checkout_render/src/third_party/abseil-cpp/)
link_directories(${CMAKE_SOURCE_DIR}/lib/)
# /home/yqw/temp/OTO/srsclient/thirdparty/lib/

# set(SOURCE_FILES main.cpp
# srsconductor.cpp)
# add_executable(${SOURCE_FILES})
# target_link_libraries(/home/yqw/temp/socket.io-client-cpp/examples/QT/client_srs/lib/libwebrtc.a pthread)




cmake_minimum_required(VERSION 2.8.3)

project(pico_demo)
add_compile_options(-std=c++17)
# add_compile_options(-std=c++14)
# add_definitions(-std=c++11)
add_definitions(-DWEBRTC_POSIX)
add_definitions(-DWEBRTC_LINUX)
# add_definitions(-D_GLIBCXX_USE_CXX11ABI=0)
# add_definitions(-D -fno-rtti)

# find_package(COMPONENTS
# )

# catkin_package()

# file(GLOB_RECURSE protobuf3.7.1_LIB "thirdparty/protobuf/lib/*.a")

file(GLOB_RECURSE SOURCES "./code/*.c")




include_directories(
    # ./include/openssl/
    # ./include/loglib
    # ./include/picohttp
    # ./include/picoquic
    # ${INCLUDE_DIRS}

    # ./code/quic
    # ./code/quictls/
    # ./code/quictls/include/
    # ./code/quictls/include/picotls
    # ./code/picotls-src/deps/cifra/src/ext

    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/include
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/include/openssl
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/include/internal

    ${CMAKE_SOURCE_DIR}/code/quic
    ${CMAKE_SOURCE_DIR}/code/quictls/
    ${CMAKE_SOURCE_DIR}/code/quictls/include/
    ${CMAKE_SOURCE_DIR}/code/quictls/include/picotls
    ${CMAKE_SOURCE_DIR}/code/picotls-src/deps/cifra/src/ext
    ${CMAKE_SOURCE_DIR}/code/include
    ${CMAKE_SOURCE_DIR}/code/include/openssl
    ${CMAKE_SOURCE_DIR}/code/include/internal
    ${CMAKE_SOURCE_DIR}/code/include/ev
)

link_directories(${CMAKE_SOURCE_DIR}/code/lib/)

add_executable(${PROJECT_NAME}
    # main.cpp
    ${SOURCES}
    client_pico.cpp
    
)
#paho-mqttpp3 paho-mqtt3cs
target_link_libraries(
    ${PROJECT_NAME}
    # ${catkin_LIBRARIES}
    # ${PROJECT_NAME}_lib
    pthread
    # libpicoquic-core.a
    # libpicohttp-core.a
    # libpicoquic-test.a

    # libpicotls-core.a
    # libpicotls-fusion.a
    # libpicotls-minicrypto.a
    # libpicotls-openssl.a
    # liblogwriter.a
    # libpicoquic-log.a


    # /home/yqw/temp/sample-cpp-demo/client-pico/lib/libquic.a
    # /home/yqw/temp/sample-cpp-demo/client-pico/lib/libquictls.a

    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libpicotls-core.a
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libpicotls-fusion.a
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libpicotls-minicrypto.a
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libpicotls-openssl.a

    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libcrypto.a
    # /home/yqw/temp/quic-ev/sample-cpp-demo/client-pico/code/lib/libssl.a
    # ev
    #以下四个库都是官方编译出来的，在picoquic/build/_deps目录下
    libpicotls-core.a
    libpicotls-fusion.a
    libpicotls-minicrypto.a
    libpicotls-openssl.a
    libcrypto.a #openssl-1.1.1d
    libssl.a #openssl-1.1.1d
    libev.so.4
    dl
    # libcrypto.so
    # libssl.so
    # bytestream.a


)

install(TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY data/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/data
)


